package sjtu.rfid.rri.services.tds;

/**
 * This interface defines the operations of EPC factory which is used to create
 * EPC tags.
 * 
 * @author jinghao
 * 
 */
public interface EPCFactory {

	/**
	 * create an EPC tag from binary, decimal, or hex formated data. <br>
	 * The data format is decided automatically. <br>
	 * 
	 * @param rawData
	 * @param type
	 *            the DataSourceType of tag data.
	 * @return an EPC tag
	 * @throws EPCParseException
	 */
	public EPC createEPCTag(String rawData, DataSourceType type)
			throws EPCParseException;

	/**
	 * create an EPC tag from binary, decimal, or hex formated data. <br>
	 * The data format is specified by radix. <br>
	 * 
	 * @param rawData
	 * @param radix
	 *            the rawData format(binary, decimal, or hex).
	 * @param type
	 *            the DataSourceType of tag data.
	 * @return an EPC tag
	 * @throws EPCParseException
	 */
	public EPC createEPCTag(String rawData, int radix, DataSourceType type)
			throws EPCParseException;

	/**
	 * create an EPC tag from a byte array of tag data. <br>
	 * 
	 * @param data
	 *            A byte array of tag data.
	 * @param type
	 *            the DataSourceType of tag data.
	 * @return an EPC tag
	 * @throws EPCParseException
	 */
	public EPC createEPCTag(byte[] data, DataSourceType type)
			throws EPCParseException;

	/**
	 * Creates an EPC tag from from uri provided.
	 * 
	 * @param uri
	 *            e.g. 'urn:epc:tag:sgtin-96:5.28505830010.19.1041970'
	 * 
	 * @return
	 * @throws EPCParseException
	 */
	public EPC createEPCTagFromURI(String uri) throws EPCParseException;
}
